<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <h2>欢迎{{name}}</h2>
        <input type="text" placeholder="按下回车提示输入" @keyup.ctrl.y="showInfo">
    </div>
</body>

<script type="text/javascript">
    Vue.config.productionTip=false;
    //Vue.config.keyCode.huiche=13    //定义了一个别名案件
    const vm=new Vue({
        el:'#root',
        data:{
            name:'小慧'
        },
        methods: {
           showInfo(e){
               //if(e.keyCode!=13) return
              // console.log(e.key,e.keyCode)
               console.log(e.target.value)
           }
        }
    })
</script>
</html>